package com.ruoyi.common.core.domain;

import proto.client.*;

import java.util.HashMap;
import java.util.Map;

/**
 * Author:cgChen
 * Date:2022/05/16 15:45
 * Description:消息体API code
 */
public class ProtoCode {
    public final static Map<Integer,Object> protoCodeMap=new HashMap<>();
    static {
        //登录
        protoCodeMap.put(101, UserInfo.Login.getDefaultInstance());
        //注册
        protoCodeMap.put(102, UserInfo.Register.getDefaultInstance());
        //重置密码
        protoCodeMap.put(103, UserInfo.ResetPass.getDefaultInstance());
        //发送短信验证码
        protoCodeMap.put(104, UserInfo.SendSms.getDefaultInstance());
        //获取用户信息
        protoCodeMap.put(105,UserInfo.ResponseSubAccountList.getDefaultInstance());
        //绑定手机号
        protoCodeMap.put(106,UserInfo.BindPhone.getDefaultInstance());
        //响应用户协议、隐私声明
        protoCodeMap.put(107,UserInfo.UserAgreement.getDefaultInstance());
        //用户协议注册、状态查询
        protoCodeMap.put(108,UserInfo.UserPactRegister.getDefaultInstance());
        //文件上传
        protoCodeMap.put(109, UploadFile.RequestUploadFile.getDefaultInstance());
        //线上消费明细
        protoCodeMap.put(110,UserInfo.RequestUserDealDetail.getDefaultInstance());
        //线下消费明细
        protoCodeMap.put(111,UserInfo.RequestUserDealDetail.getDefaultInstance());
        //我的钱包
        protoCodeMap.put(112,UserInfo.MyWallet.getDefaultInstance());
        //预留资产列表
        protoCodeMap.put(113,UserInfo.RequestKeepPirceList.getDefaultInstance());
        //预留资产兑换活动VC
        protoCodeMap.put(114,UserInfo.RequestKeepPirceConvertVC.getDefaultInstance());
        //用户注册协议状态响应
        protoCodeMap.put(115,UserInfo.UserPactRegisterStatus.getDefaultInstance());
        //系统公告列表
        protoCodeMap.put(201, Main.ResponseNotices.getDefaultInstance());
        //轮播图
        protoCodeMap.put(202,Main.Carousel.getDefaultInstance());
        //新闻咨询
        protoCodeMap.put(203,Main.NewsAdvisory.getDefaultInstance());
        //导航菜单
        protoCodeMap.put(204,Main.Navigation.getDefaultInstance());
        //商品列表
        protoCodeMap.put(205,Main.RequestGoods.getDefaultInstance());
        //商品列表
        protoCodeMap.put(206,Main.GoodsType.getDefaultInstance());
        //客服消息
        protoCodeMap.put(207,Main.RequestCustomerMsg.getDefaultInstance());
        //VC、产品订购开始时间展示
        protoCodeMap.put(208,Main.StartTime.getDefaultInstance());
        //搜索
        protoCodeMap.put(209,Main.RequestSearch.getDefaultInstance());
        //商品列表请求（活动专区、线上券兑换、认购专区）
        protoCodeMap.put(210,Main.RequestGoodsOtherList.getDefaultInstance());
        //拼团商品
        protoCodeMap.put(301, GoodsGroup.RequestGoodsGroup.getDefaultInstance());
        //预约拼团
        protoCodeMap.put(302,GoodsGroup.RequestReserveGroup.getDefaultInstance());
        //订购明细
        protoCodeMap.put(303,GoodsGroup.RequestGoodsGroupDetails.getDefaultInstance());
        //交易明细
        protoCodeMap.put(304,GoodsGroup.RequestTradeDetails.getDefaultInstance());
        //领取拼团红包
        protoCodeMap.put(305,GoodsGroup.RequestReceiveRedPack.getDefaultInstance());
        //修改登录密码、交易密码
        protoCodeMap.put(401, SystemSetting.RequestPassSetting.getDefaultInstance());
        //查看银行账号
        protoCodeMap.put(402,SystemSetting.ResponseBindBank.getDefaultInstance());
        //绑定银行账号
        protoCodeMap.put(403,SystemSetting.RequestBindBank.getDefaultInstance());
        //收款银行
        protoCodeMap.put(404,SystemSetting.ResponseBank.getDefaultInstance());
        //充值申请
        protoCodeMap.put(405,SystemSetting.RequestRecharge.getDefaultInstance());
        //充值列表
        protoCodeMap.put(406,SystemSetting.ResponseRecharge.getDefaultInstance());
        //提现申请
        protoCodeMap.put(407,SystemSetting.RequestWithdraw.getDefaultInstance());
        //提现列表
        protoCodeMap.put(408,SystemSetting.ResponseWithdraw.getDefaultInstance());
        //收货地址列表
        protoCodeMap.put(409,SystemSetting.ResponseAddressList.getDefaultInstance());
        //添加、编辑收货地址
        protoCodeMap.put(410,SystemSetting.RequestAddress.getDefaultInstance());
        //退出登录
        protoCodeMap.put(411,SystemSetting.RequestLogOut.getDefaultInstance());
        //查询收货地址
        protoCodeMap.put(412,SystemSetting.RequestAddressDetail.getDefaultInstance());
        //删除收货地址
        protoCodeMap.put(413,SystemSetting.RequestRemoveAddress.getDefaultInstance());
        //用户资金额度数据
        protoCodeMap.put(414,SystemSetting.ResponseUserPrice.getDefaultInstance());
        //个人推广码
        protoCodeMap.put(501, Popularize.ResponsePersonalCode.getDefaultInstance());
        //推广奖励
        protoCodeMap.put(502,Popularize.RequestPerformanceReward.getDefaultInstance());
        //我的业绩
        protoCodeMap.put(503,Popularize.ResponseMyTeam.getDefaultInstance());
        //申请运营中心
        protoCodeMap.put(601, OperationCenter.RequestApplyOperation.getDefaultInstance());
        //获取收款人信息
        protoCodeMap.put(602,OperationCenter.RequestCustomer.getDefaultInstance());
        //运营中心转账
        protoCodeMap.put(603,OperationCenter.RequestTransferOperation.getDefaultInstance());
        //获取运营中心申请信息 响应
        protoCodeMap.put(604,OperationCenter.ResponseOperation.getDefaultInstance());
        //会员转账列表
        protoCodeMap.put(605,OperationCenter.RequestVipTransfers.getDefaultInstance());
        //余额兑换VC
        protoCodeMap.put(701, ExchangeVC.RequestBalanceToVC.getDefaultInstance());
        //VC兑换列表
        protoCodeMap.put(702,ExchangeVC.RequestBalanceToVCParam.getDefaultInstance());
        //VC兑换余额
        protoCodeMap.put(703,ExchangeVC.RequestVcToBalanceParam.getDefaultInstance());


        //显示拼团基金红包
        protoCodeMap.put(901,PersonalSetting.ResponseGroupRedPack.getDefaultInstance());
        //领取拼团基金红包
        protoCodeMap.put(902,PersonalSetting.ResponseGroupRedPack.getDefaultInstance());
        //领取拼团基金到总产值
        protoCodeMap.put(903,PersonalSetting.ResponseGroupRedPack.getDefaultInstance());
        //查询个人资料
        protoCodeMap.put(904,PersonalSetting.ResponsePersonalMaterial.getDefaultInstance());
        //上传头像
        protoCodeMap.put(905,PersonalSetting.RequestUploadAvatar.getDefaultInstance());
        //修改姓名
        protoCodeMap.put(906,PersonalSetting.RequestSetUserName.getDefaultInstance());

        //FTC市场列表
        protoCodeMap.put(1001, MarketFtc.ResponseMarketFTC.getDefaultInstance());
        //发起出售、求购FTC请求
        protoCodeMap.put(1002,MarketFtc.RequestSaleOrBuyFTC.getDefaultInstance());
        //ftc市场流通价格展示
        protoCodeMap.put(1003,MarketFtc.ResponseMarketFTCPrice.getDefaultInstance());
        //判断是否可以申请预备经理
        protoCodeMap.put(1101, Manager.RequestManager.getDefaultInstance());
        //申请预备经理
        protoCodeMap.put(1102, Manager.RequestApplyManager.getDefaultInstance());
        //判断是否可以申请预备经理
        protoCodeMap.put(1103, Manager.RequestDirector.getDefaultInstance());
        //判断是否可以申请预备经理
        protoCodeMap.put(1104, Manager.RequestApplyDirector.getDefaultInstance());

    }
    public static enum ProtoApi{
        Login(101,"登录"),
        Register(102,"注册"),
        ResetPass(103,"重置密码"),
        SendSms(104,"发送短信"),
        UserList(105,"获取用户信息"),
        BindPhone(106,"绑定手机号"),
        UserAgreement(107,"用户协议内容"),
        UserPactRegister(108,"用户协议注册"),
        RequestUploadFile(109, "上传文件"),
        UserDealDetailOnline(110, "线上消费明细"),
        UserDealDetailOffline(111, "线下消费明细"),
        MyWallet(112, "我的钱包"),
        KeepPirceList(113, "预留资产列表"),
        KeepPirceConvertVC(114, "预留资产兑换活动VC"),
        UserPactRegisterStatus(115,"用户协议注册状态查询"),


        ResponseNotices(201,"系统公告列表"),
        Carousel(202,"轮播图"),
        NewsAdvisory(203,"新闻咨询"),
        Navigation(204,"导航菜单"),
        RequestGoods(205,"商品列表"),
        GoodsType(206,"数据类型字典"),
        RequestCustomerMsg(207,"客服消息"),
        StartTime(208,"VC、产品订购开始时间展示"),
        RequestSearch(209,"搜索"),
        RequestGoodsOtherList(210,"商品列表请求（活动专区、线上券兑换、认购专区）"),
        RequestGoodsGroup(301,"拼团商品"),
        RequestReserveGroup(302,"预约拼团"),
        RequestGoodsGroupDetails(303,"订购明细"),
        RequestTradeDetails(304,"交易明细"),
        RequestReceiveRedPack(305,"领取拼团红包"),
        RequestPassSetting(401,"修改登录密码、交易密码"),
        ResponseBindBank(402,"查看银行账号"),
        RequestBindBank(403,"绑定银行账号"),
        ResponseBank(404,"收款银行"),
        RequestRecharge(405,"充值申请"),
        ResponseRecharge(406,"充值列表"),
        RequestWithdraw(407,"提现申请"),
        ResponseWithdraw(408,"提现列表"),
        ResponseAddressList(409,"收货地址列表"),
        RequestAddress(410,"添加、编辑收货地址"),
        RequestLogOut(411,"退出登录"),
        RequestAddressDetail(412,"查询收货地址"),
        RequestRemoveAddress(413,"删除收货地址"),
        ResponseUserPrice(414,"用户资金额度数据"),
        ResponsePersonalCode(501,"个人推广码"),
        RequestPerformanceReward(502,"推广奖励"),
        ResponseMyTeam(503,"我的业绩"),
        RequestApplyOperation(601,"申请运营中心"),
        RequestCustomer(602,"获取收款人信息"),
        RequestTransferOperation(603,"运营中心转账"),
        ResponseOperation(604,"获取运营中心申请信息"),
        RequestVipTransfers(605,"会员转账列表"),
        RequestBalanceToVC(701,"余额兑换VC"),
        RequestBalanceToVCParam(702,"VC兑换列表"),
        RequestVcToBalanceParam(703,"VC兑换余额"),
        ResponseAddShoppingCart(801,"添加购物车"),
        ResponseDelShoppingCart(802,"删除购物车"),
        ResponseEditShoppingCart(803,"修改购物车数量"),
        ResponseShoppingCartList(804,"购物车列表"),
        PayOrder(805,"付款订单"),
        OrderList(806,"订单列表"),
        EditOrderStatus(807,"更改收货状态"),



        ResponseGroupRedPack(901,"显示拼团基金红包"),
        RequestGroupRedPack(902,"领取拼团基金红包"),
        RequestGroupTotalValue(903,"领取拼团基金到总产值"),
        ResponsePersonalMaterial(904,"查询个人资料"),
        RequestUploadAvatar(905,"上传头像"),
        RequestSetUserName(906,"修改姓名"),
        ResponseMarketFTC(1001,"FTC市场列表"),
        RequestSaleOrBuyFTC(1002,"发起出售、求购FTC请求"),
        ResponseMarketFTCPrice(1003,"ftc市场流通价格展示"),

        RequestManager(1101,"判断是否可以申请预备经理"),
        RequestApplyManager(1102,"申请预备经理"),
        RequestDirector(1103,"判断是否可以申请预备经理"),
        RequestApplyDirector(1104,"判断是否可以申请预备经理"),
        ;
        ProtoApi(int code,String msg){
            this.code=code;
            this.msg=msg;
        }
        private int code;

        public int getCode() {
            return code;
        }

        public void setCode(int code) {
            this.code = code;
        }

        public String getMsg() {
            return msg;
        }

        public void setMsg(String msg) {
            this.msg = msg;
        }

        private String msg;
    }

    public static Object protoCodeMap(int code) {
        return protoCodeMap.get(code);
    }
}
